package com.servlet;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import hyl.core.MyFun;

/**
 * Application Lifecycle Listener implementation class StartUp
 */
@WebListener
public class MyListener implements ServletContextListener {

	/**
	 * Default constructor.
	 */
	public MyListener() {

	}

	/**
	 * @see ServletContextListener#contextDestroyed(ServletContextEvent)
	 */
	public void contextDestroyed(ServletContextEvent sce) {
	
		My.Log.info("网站关闭了..........");
		My.exit();

	}

	/**
	 * @see ServletContextListener#contextInitialized(ServletContextEvent)
	 */
	public void contextInitialized(ServletContextEvent sce) {

		// Properties properties = System.getProperties();
		// System.out.println("java.class.path::" +
		// properties.getProperty("java.class.path"));
		// System.out.println("加载");
		// MyPath.test(this.getClass());
		My.getInstance();
		MyFun.print("监听器已实例化,初始化上下文完成");
		My.Log.info("网站启动了..............");

		// System.out.println("StartUpListener-1:设置文件默认路径");
	}

}
